# -*- encoding: utf-8 -*-

class Xor (object):

    """ Classe définissant une instruction XOR Ra, Rb, Rc. """

    def __init__ (self, ra, rb, rc, mem):
        self.__ra = ra
        self.__rb = rb
        self.__rc = rc
        self.__val = val
        self.__mem = mem

    def do (self):
        self.__mem.setRegister(
            num = self.__ra,
            newVal = self.__mem.getRegister(self.__rb) ^ self.__mem.getRegister(self.__rc)
            )

    def __str__ (self):
        "xor r{0:d} r{1:d} r{2:d}".format(self.__ra, self.__rb, self.__rc)

    def __unicode__ (self):
        return str(self)
